#pragma once

class InputManager;
class Camera;
class Terrain;
class Army;
class Obj;
class BoxSelector;

#include "graphics/Rect2D.h"
#include "input/InputManager.h"

class Player
{
public:
    Player(Packets::PlayerStartInfo startInfo);
    ~Player();
    void draw(float dt, bool toScreen);
	void encode(std::vector<unsigned char> & buf);
	void decode(std::vector<unsigned char> & buf);
    bool hasId(int _id) { return id == _id; }
    int getId() { return id; }
    glm::mat4& getViewMatrix();
	Camera* getCamera() { return camera; }

	InputManager* input;
	Army* army;
private:
    void handleInput(float dt);

    float moveSpeed;
	BoxSelector boxSelector;
    Camera* camera;
    Terrain* terrain;

    int id;
    glm::ivec2 prevMousePos;
    FBO_RB pickingFBO;

    glm::ivec2 mouseRect[2];
};

